﻿using System;
using System.Windows.Forms;
using System.Drawing;


namespace ErgoBreak.Presentation.Components
{
    public class Tray : IDisposable
    {
        private NotifyIcon tray;
        private Icon enbaled;
        private Icon disabled;
        private bool isEnabled;

        public Tray(NotifyIcon notifyIcon, Icon enabledIcon, Icon disabledIcon)
        {
            this.tray = notifyIcon;
            this.enbaled = enabledIcon;
            this.disabled = disabledIcon;
            this.isEnabled = true;
        }

        public bool Enabled
        {
            get
            {
                return this.isEnabled;

            }
            set
            {
                if (value)
                {
                    this.isEnabled = true;
                    tray.Icon = enbaled;
                }
                else
                {
                    this.isEnabled = false;
                    tray.Icon = disabled;
                }
            }
        }

        public void Dispose()
        {
            this.tray.Dispose();
        }
    }
}
